/**
 * Created by dengchao on 2016/4/6.
 */


(function ($){


    /*页面加载的时候判断是session中是否有值*/
    $.ajax({
        url:'mysession.do',
        type:'get',
        async:true,
        data:{},
        //dataType:'json',
        success:function (data){
            //console.log(typeof data);
            if(data=='1'){
                $("#logbtn").text("签到");
                $("#logbtn").on("tap",function (){
                    console.log(1);
                })
            }else{
                $("#logbtn").on("tap",function (){
                    window.location.href='../pages/Login.html'
                })
            }
        }
    });
    //页脚的js调用
    navbind();
    /*用户详情的跳转*/
    $("#userImg").on("tap",function(){
        $.ajax({
            url:'mysession.do',
            type:'get',
            async:true,
            datat:{},
            success:function(data){
                if(data=='1'){
                    window.location.href="../pages/myInformation.html";
                }else{
                    window.location.href='../pages/Login.html';
                }
            }
        });


        //console.log(1);
    });

    /*积分的跳转*/
    $("#content2-jifen").on("tap",function (){
       window.location.href="../pages/myIntegral.html";
    });

    /*收藏的跳转*/
    $("#content2-shoucang").on("tap",function (){
        window.location.href="../pages/myFavorite.html";
    });


    /*发布的跳转*/
    $("#content2-fabu").on("tap",function (){
        window.location.href="../pages/myPublish.html"
    });
   //// login
   //$("#logbtn").on("tap",function (){
   //     window.location.href="../pages/Login.html"
   // });

    $(".content3 .textContainer:nth-child(2)").on("tap", function () {
        window.location.href="../pages/connectUs.html"

    });

    /*设置跳转*/
    $(".content3 .textContainer:last-child").on("tap",function (){
        window.location.href="../pages/setUp.html"
    });


    /*每次跳转到这个页面的时候获取url进行判断*/
    var app = angular.module("myapp",[]);
    app.controller("myctr",function ($scope,$http){

    })





})(jQuery);